package com.zzedu.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zzedu.common.annotation.Excel;
import jakarta.validation.constraints.NotNull;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 学生续费、分班日志对象 zz_stu_log
 *
 * @author Mr.Wang
 * @date 2025-06-08
 */
@TableName("zz_stu_log")
public class ZzStuLog implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 学生ID
     */
    @Excel(name = "学生ID")
    private Long stuId;

    /**
     * 操作 1-分班 2-续费
     */
    @Excel(name = "操作 1-分班 2-续费")
    private Integer action;

    /**
     * 班级ID action=2 有值
     */
    @Excel(name = "班级ID action=2 有值")
    private Long clzzId;

    /**
     * 操作类型 action=2  1-加入班级 2-退出班级
     * action=1 续费类型  1-季度。2-半年 3-全年
     */
    private Long oper;

    /**
     * 会员到期时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "会员到期时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime expireAt;

    /**
     * 添加时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "添加时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    @NotNull(message = "添加时间不能为空")
    private LocalDateTime gmtCreate;

    /**
     * 逻辑删除(0：未删除 1：id)
     */
    @Excel(name = "逻辑删除(0：未删除 1：id)")
    @TableLogic(delval = "id")
    @TableField(fill = FieldFill.INSERT)
    @NotNull(message = "逻辑删除(0：未删除 1：id)不能为空")
    private Integer deleted;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime gmtModify;

    /**
     * 创建人
     */
    @TableField(fill = FieldFill.INSERT)
    private Long createBy;

    /**
     * 修改人
     */
    @TableField(fill = FieldFill.UPDATE)
    private Long updateBy;

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setStuId(Long stuId) {
        this.stuId = stuId;
    }

    public Long getStuId() {
        return stuId;
    }

    public void setAction(Integer action) {
        this.action = action;
    }

    public Integer getAction() {
        return action;
    }

    public void setClzzId(Long clzzId) {
        this.clzzId = clzzId;
    }

    public Long getClzzId() {
        return clzzId;
    }

    public void setOper(Long oper) {
        this.oper = oper;
    }

    public Long getOper() {
        return oper;
    }

    public void setExpireAt(LocalDateTime expireAt) {
        this.expireAt = expireAt;
    }

    public LocalDateTime getExpireAt() {
        return expireAt;
    }

    public void setGmtCreate(LocalDateTime gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public LocalDateTime getGmtCreate() {
        return gmtCreate;
    }

    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }

    public Integer getDeleted() {
        return deleted;
    }

    public void setGmtModify(LocalDateTime gmtModify) {
        this.gmtModify = gmtModify;
    }

    public LocalDateTime getGmtModify() {
        return gmtModify;
    }

    public void setCreateBy(Long createBy) {
        this.createBy = createBy;
    }

    public Long getCreateBy() {
        return createBy;
    }

    public void setUpdateBy(Long updateBy) {
        this.updateBy = updateBy;
    }

    public Long getUpdateBy() {
        return updateBy;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
    }
}
